package router

import (
	"github.com/gin-gonic/gin"
	"lht-go-plugins/LhtWebApi/internal"
	"lht-go-plugins/LhtWebApi/middleware"
)

func InitRoutes() *gin.Engine {
	r := gin.Default()

	// 登录
	r.POST("/login", internal.LoginHandler)

	// 需要 JWT + Casbin 权限的接口组
	auth := r.Group("/api")
	{
		auth.Use(middleware.JWTAuthMiddleware())
		//auth.Use(middleware.AESDecryptMiddleware()) // 全局 AES 解密
		auth.GET("/user/info", internal.UserInfoHandler)
	}

	return r
}
